package com.yxtec.sc.service;

import com.yxtec.sc.model.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.client.RestTemplate;

import java.util.List;

/**
 * Created by jerrie on 17-6-22.
 *
 * @author :<a href="mailto:liujie@ebnew.com">刘杰</a>
 * @date :2017-06-22 12:58:56
 */
@Service
public class MyService {

    @Autowired
    private RestTemplate restTemplate;

    private final String SERVICE_NAME = "sc1-service";

    public void printFirstUser() {
        User user = restTemplate.getForObject("http://"+SERVICE_NAME+"/user", User.class);
        System.out.println(user);
    }

}
